Typescript: how to do type narrowing in an object mapper

visit shbcf.ru